import { Model, DataTypes } from 'sequelize'
import { sequelize } from "../config/index.js"

// 定义一个 Category 类 继承 Model
class Category extends Model {}

// 通过 init 方法定义表的字段等信息
Category.init(
  {
    categoryName: {
      type: DataTypes.STRING,
      allowNull: false,
      unique: true,
    }
  },
  { sequelize, modelName: 'Category' }
)

export default Category